@import '../../../vendor/bower/bootstrap/less/variables';

@body-bg: #f1f1f1;
@admin-icon-color: #999;

@admin-navbar-bg: #222;
@admin-navbar-color: #eee;
@admin-navbar-link-color: #eee;
@admin-navbar-height: @padding-large-horizontal * 2;
@admin-navbar-screen-xs-height: @admin-navbar-height + 16;
@admin-navbar-dropdown-bg: #333;
@admin-navbar-link-hover-bg: @admin-navbar-dropdown-bg;

@admin-menu-bg: #222;
@admin-menu-link-color: #eee;
@admin-menu-link-hover-color: @link-hover-color;
@admin-menu-topmenu-hover-bg: #111;
@admin-menu-currentmenu-bg: @link-hover-color;
@admin-menu-currentmenu-color: #fff;
@admin-menu-submenu-link-color: #bbb;
@admin-menu-submenu-bg: #333;
@admin-menu-currentmenu-submenu-bg: @admin-menu-submenu-bg;
@admin-menu-currentmenu-arrow-bg: @body-bg;

/* common */
body {
  background-color: @body-bg;
}

legend {
  font-size: 16px;
  margin-bottom: 10px;
  padding-bottom: 10px;
}

a.asc:after, a.desc:after {
  position: relative;
  top: 1px;
  display: inline-block;
  font-family: 'Glyphicons Halflings';
  font-style: normal;
  font-weight: normal;
  line-height: 1;
  padding-left: 5px;
}

a.asc:after {
  content: /*"\e113"*/ "\e151";
}

a.desc:after {
  content: /*"\e114"*/ "\e152";
}

.sort-numerical a.asc:after {
  content: "\e153";
}

.sort-numerical a.desc:after {
  content: "\e154";
}

.sort-ordinal a.asc:after {
  content: "\e155";
}

.sort-ordinal a.desc:after {
  content: "\e156";
}

.required label:before {
  content: "*";
  color: #a94442;
  margin-right: 5px;
  font-weight: bold;
}

/* main layout */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

#wrap {
  height: auto;
  min-height: 100%;
  width: 100%;
  position: relative;
  -webkit-font-smoothing: subpixel-antialiased;

  .breadcrumb {
    margin: 0 -15px;
  }
}

#content {
  height: 100%;
}

#footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  color: #777;
}

#content,
#footer {
  margin-left: 160px;
  .folded & {
    margin-left: 36px;
  }

  @media (max-width: @screen-sm-max) {
    .auto-fold & {
      margin-left: 36px;
    }
  }
  @media (max-width: @screen-xs-max) {
    .auto-fold & {
      margin-left: 0;
    }

    .auto-fold .responsive-open & {
      margin-left: 190px;
    }
  }
}

#body {
  position: relative;
}

#body-content {
  float: left;
  overflow: visible;
  width: 100%;
  padding: @admin-navbar-height 0;
  @media (max-width: @screen-xs-max) {
    padding-top: @admin-navbar-screen-xs-height;
  }
}

#content h1 {
  font-size: 23px;
}

#content h2 {
  font-size: 18px;
}

/* login layout */

.login {
  h1 {
    text-align: center;
  }

  body& {
    background-color: #f1f1f1;
  }

  .login-wrap {
    width: 320px;
    padding: 8% 0 0;
    margin: auto;
  }

  form {
    margin: @padding-large-horizontal auto;
    padding: @padding-large-horizontal @padding-large-horizontal 0;
    overflow: hidden;
    font-weight: normal;
    background: #fff;
    -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .13);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .13);
  }

  .login-nav {
    list-style: none;
    padding-left: @padding-large-horizontal;
  }
}

/* admin navbar */

#admin-navbar {
  position: fixed;
  top: 0;
  z-index: 101;
  width: 100%;
  height: @admin-navbar-height;
  font-size: 13px;
  line-height: @admin-navbar-height;
  color: @admin-navbar-color;
  background-color: @admin-navbar-bg;

  @media (max-width: @screen-xs-max) {
    position: absolute;
  }

  > .navbar-nav {
    margin: 0;
  }

  a {
    color: @admin-navbar-link-color;
    border: none;
    text-decoration: none;
    background: none;
    outline: none;

    &:hover,
    &:focus,
    &:active {
      color: @link-hover-color;
    }
  }

  .nav > li > a {
    height: @admin-navbar-height;
    line-height: @admin-navbar-height;
    padding: 0 @navbar-padding-horizontal / 2;

    &:hover,
    &:focus {
      background-color: @admin-navbar-link-hover-bg;
    }

    > .icon {
      position: relative;
      top: 8px;
      margin-right: 5px;
      color: @admin-icon-color;

    }

    &:hover,
    &:focus {
      > .icon {
        color: @link-hover-color;
      }
    }

    > .dashicons-admin-home {
      top: 6px;
    }
  }

  .nav > li {
    &.dropdown.open > a {
      color: @link-hover-color;
      background-color: @admin-navbar-link-hover-bg;
      > .icon {
        color: @link-hover-color;
      }
    }

    &.open > .dropdown-menu {
      position: absolute;
    }

    & > .dropdown-menu {
      margin: 0;
      font-size: 13px;
      color: @admin-navbar-color;
      background: @admin-navbar-dropdown-bg;
      border-radius: 0;
      -webkit-box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
      box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
      border-color: @admin-navbar-dropdown-bg;

      > li > a {
        padding: 3px 10px;
      }
    }
  }

  #admin-menu-toggle {
    display: none;
    .responsive-open & {
      background-color: @admin-navbar-link-hover-bg;
    }
  }

  .primary-nav {
    float: left;

    > li {
      &:extend(#admin-navbar .primary-nav)
    ;
      > a {
        &:extend(#admin-navbar .primary-nav)
      ;
      }
    }
  }

  .secondary-nav {
    float: right;
    > li {
      &:extend(#admin-navbar .secondary-nav)
    ;
      > a {
        &:extend(#admin-navbar .secondary-nav)
      ;
      }
    }

    .dropdown-menu {
      right: 0;
      left: auto;
    }
  }

  @media (max-width: @screen-xs-max) {
    #admin-menu-toggle {
      display: block;
    }

    & {
      font-size: 14px;
      left: 0 !important;
      z-index: 500 !important;
      height: @admin-navbar-screen-xs-height;
      line-height: @admin-navbar-screen-xs-height;
      min-width: 300px;

      .nav > li > a {
        height: @admin-navbar-screen-xs-height;
        line-height: @admin-navbar-screen-xs-height;
      }

      .icon {
        font-size: 40px;
      }

      .dashicons {
        width: auto;
        height: auto;
      }

      .menu-name {
        display: none;
      }
    }

    .nav > li > .dropdown-menu {
      font-size: 16px;
      width: 100%;
      position: fixed !important;
      top: @admin-navbar-screen-xs-height;

      > li > a {
        padding: 10px 20px;
      }
    }
  }

}

/* admin menu */

#admin-menu-back,
#admin-menu-wrap,
#admin-menu > .nav,
#admin-menu .sub-nav {
  width: 160px;
  background-color: @admin-menu-bg;

  .folded & {
    width: 36px;
  }

  @media (max-width: @screen-sm-max) {
    .auto-fold & {
      width: 36px;
    }
  }

  @media (max-width: @screen-xs-max) {
    .auto-fold & {
      width: 190px;
    }
  }
}

#admin-menu-wrap {
  padding-top: @admin-navbar-height;
  float: left;

  @media (max-width: @screen-xs-max) {
    .auto-fold & {
      padding-top: @admin-navbar-screen-xs-height;
      display: none;
    }

    .auto-fold .responsive-open & {
      display: block;
    }
  }
}

#admin-menu-back {
  position: absolute;
  top: @admin-navbar-height;
  bottom: 0;
  z-index: 99;
}

#admin-menu {
  position: relative;
  z-index: 100;
  float: left;

  .sticky-menu & {
    position: fixed;
  }

  @media (max-width: @screen-xs-max) {
    .auto-fold & {
      position: absolute;
    }
  }

  > .nav {
    margin-top: @padding-large-vertical;
  }

  a {
    color: @admin-menu-link-color;
  }

  a:hover,
  a:focus,
  a:active {
    color: @admin-menu-link-hover-color;
    background-color: transparent;
    text-decoration: none;
    outline: none;
  }

  .top-menu:hover,
  .open-sub > a,
  .top-menu > a:focus {
    position: relative;
    background-color: @admin-menu-topmenu-hover-bg;
  }

  .top-menu {
    > a {
      padding: @padding-base-vertical @padding-base-horizontal;
      @media (max-width: @screen-xs-max) {
        padding: @padding-large-vertical @padding-large-horizontal;
        font-size: 16px;
      }

      &:hover,
      &:focus {
        > .menu-icon {
          color: @admin-menu-link-hover-color;
        }
      }

      > .menu-icon {
        margin-left: -@padding-base-horizontal / 2;
        color: @admin-icon-color;
      }
    }

    &:hover > a,
    &.open-sub > a {
      color: @admin-menu-link-hover-color;

      > .menu-icon {
        color: @admin-menu-link-hover-color;
      }

      &:hover,
      &:focus {
        & > .menu-icon {
          color: @admin-menu-link-hover-color;
        }
      }
    }
  }

  .top-menu:hover > a {
    color: @admin-menu-link-hover-color;
  }

  .current-menu {
    > a,
    > a:hover,
    > a:focus {
      color: @admin-menu-currentmenu-color;
      background-color: @admin-menu-currentmenu-bg;
    }

    &,
    &:hover,
    &.open-sub {
      > a {
        > .menu-icon {
          color: @admin-menu-currentmenu-color;
        }
        &:hover,
        &:focus {
          & > .menu-icon {
            color: @admin-menu-currentmenu-color;
          }
        }
      }
    }
  }

  .sub-nav-default-position(@left:160px) {
    position: absolute;
    top: -1000em;
    left: @left;
  }

  .sub-nav-default-appearance() {
    -webkit-box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
    background-color: @admin-menu-submenu-bg;
  }

  .sub-nav {
    overflow: hidden;
    padding: @padding-small-horizontal/2 0;
    word-wrap: break-word;
    list-style: none;

    .sub-nav-default-position();
    .sub-nav-default-appearance();

    .folded & {
      left: 36px;
      width: 160px;
    }

    @media (max-width: @screen-sm-max) {
      .auto-fold & {
        left: 36px;
        width: 160px;
      }
    }

    @media (max-width: @screen-xs-max) {
      .auto-fold & {
        position: static;
        width: 190px;
        -webkit-box-shadow: none;
        box-shadow: none;
        display: none;
      }
    }

    a {
      color: @admin-menu-submenu-link-color;
      display: block;
      padding: @padding-base-vertical @padding-base-horizontal;
      font-size: 13px;
      line-height: 1.2;

      &:hover,
      &:focus {
        color: @admin-menu-link-hover-color;
      }

      @media (max-width: @screen-xs-max) {
        font-size: 16px;
        padding: @padding-large-vertical @padding-large-horizontal;
      }
    }

    > .active > a {
      font-weight: bold;
      color: @admin-menu-currentmenu-color;

      &:hover,
      &:focus {
        color: @admin-menu-currentmenu-color;
      }
    }

  }

  @media (max-width: @screen-xs-max) {
    .auto-fold & .selected .sub-nav {
      display: block;
    }
  }

  .menu-name() {
    position: absolute;
    width: 160px;
    left: 36px;
    top: -1000em;
    display: block;
    padding: @padding-base-vertical @padding-base-horizontal;
    background-color: @admin-menu-submenu-bg;
    color: @admin-menu-submenu-link-color;
  }

  .folded & .menu-name {
    .menu-name();
  }

  @media (max-width: @screen-sm-max) {
    .auto-fold & .menu-name {
      .menu-name();
    }
  }

  @media (max-width: @screen-xs-max) {
    .auto-fold & .menu-name {
      position: static;
      left: auto;
      top: auto;
      display: inline;
      padding: 0;
      background: transparent;
      color: inherit;
    }
  }

  .folded & .has-sub:hover .menu-name,
  .folded & .open-sub .menu-name {
    top: 0;
  }

  @media (max-width: @screen-sm-max) {
    .auto-fold & .has-sub:hover .menu-name,
    .auto-fold & .open-sub .menu-name {
      top: 0;
    }
  }

  .has-sub:hover .sub-nav,
  .open-sub .sub-nav {
    top: -1px;

    .folded & {
      top: @font-size-base * @line-height-base + @padding-base-vertical * 2;
    }

    @media (max-width: @screen-sm-max) {
      .auto-fold & {
        top: @font-size-base * @line-height-base + @padding-base-vertical * 2;
      }
    }
  }

  .arrow() {
    position: absolute;
    right: 0;
    top: 50%;
    width: 0;
    border-style: solid;
    border-color: transparent;
    height: 0;
    pointer-events: none;
    content: " "
  }

  .arrow-size(@offset:8px) {
    border-width: @offset;
    margin-top: -@offset;
  }

  .has-sub:hover,
  .has-sub.open-sub,
  .current-menu {
    > a:after {
      .arrow();
      .arrow-size();

      .folded & {
        .arrow-size(4px);
      }

      @media (max-width: @screen-sm-max) {
        .auto-fold & {
          .arrow-size(4px);
        }
      }

      @media (max-width: @screen-xs-max) {
        .auto-fold & {
          .arrow-size(8px);
        }
      }
    }
  }

  .not-current-menu:hover,
  .not-current-menu.open-sub {
    > a:after {
      border-right-color: @admin-menu-submenu-bg;
    }

    @media (max-width: @screen-xs-max) {
      > a:after {
        display: none;
      }
    }
  }

  .current-menu:hover,
  .current-menu.open-sub {
    > a {
      color: @admin-menu-currentmenu-color;

      .folded &:after {
        display: none;
      }

      @media (max-width: @screen-xs-max) {
        .auto-fold &:after {
          display: block;
          border-right-color: @admin-menu-currentmenu-arrow-bg;
        }
      }
    }
  }

  .current-menu .sub-nav {
    top: auto;
    left: auto;
    position: static;
    background-color: @admin-menu-currentmenu-submenu-bg;
    box-shadow: none;
    -webkit-box-shadow: none;

    .folded & {
      .sub-nav-default-position(36px);
      .sub-nav-default-appearance();
    }

    @media (max-width: @screen-sm-max) {
      .auto-fold & {
        .sub-nav-default-position(36px);
        .sub-nav-default-appearance();
      }
    }

    @media (max-width: @screen-xs-max) {
      .auto-fold & {
        position: static;
        display: block;
        box-shadow: none;
        -webkit-box-shadow: none;
      }
    }
  }

  .current-menu,
  .current-menu.has-sub:hover,
  .current-menu.open-sub {
    > a:after {
      border-right-color: @admin-menu-currentmenu-arrow-bg;
    }
  }

  @media (max-width: @screen-sm-max) {
    .auto-fold & .current-menu.has-sub:hover {
      > a:after {
        border-right-color: @admin-menu-currentmenu-bg;
      }
    }
  }

  @media (max-width: @screen-xs-max) {
    .auto-fold & .current-menu.has-sub:hover {
      > a:after {
        border-right-color: @admin-menu-currentmenu-arrow-bg;
      }
    }
  }

  .folded & .current-menu.has-sub:hover > a {
    > .menu-name {
      background-color: @admin-menu-currentmenu-bg;
      color: @admin-menu-currentmenu-color;
    }
  }

  @media (max-width: @screen-sm-max) {
    .auto-fold & .current-menu.has-sub:hover > a {
      > .menu-name {
        background-color: @admin-menu-currentmenu-bg;
        color: @admin-menu-currentmenu-color;
      }
    }
  }

}

#collapse-menu {
  margin: 10px 0 0 5px;
  border: 0;
  font-size: 12px;
  background-color: transparent;
  color: @admin-menu-link-color;

  &:hover,
  &:focus,
  &:active {
    color: @admin-menu-link-hover-color;
    outline: none;
  }

  .dashicons {
    margin-left: -@padding-base-horizontal / 2;
    color: @admin-icon-color;

    .folded & {
      transform: rotate(180deg);
      -webkit-transform: rotate(180deg);
      -ms-transform: rotate(180deg);
    }

    @media (max-width: @screen-sm-max) {
      .auto-fold & {
        transform: rotate(180deg);
        -webkit-transform: rotate(180deg);
        -ms-transform: rotate(180deg);
      }
    }
  }

  &:hover .dashicons,
  &:focus .dashicons {
    color: @admin-menu-link-hover-color;
  }

  .collapse-tip {
    position: relative;
    top: 2px;

    .folded & {
      display: none;
    }
  }

  @media (max-width: @screen-sm-max) {
    .auto-fold & .collapse-tip {
      display: none;
    }
  }

  @media (max-width: @screen-xs-max) {
    .auto-fold & {
      display: none;
    }
  }
}

.panel() {
  background-color: #fff;
  border: 1px solid #e5e5e5;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
  -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
  -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

/* grid */
.detail-view {
  .panel();
}

.grid-view {
  .depth-1 {
    padding-left: 1em;
  }

  .depth-2 {
    padding-left: 2em;
  }

  .depth-3 {
    padding-left: 3em;
  }

  .col-checkbox {
    width: 2em;
  }

  .col-media-icon {
    width: 80px;
    text-align: center;

    img {
      max-width: 80px;
      max-height: 60px;
    }
  }

  .col-id {
    width: 4em;
  }

  .summary {
    padding: @padding-large-vertical 0;
    text-align: right;
  }

  .table {
    table-layout: fixed;

    .panel();
    th,
    td {
      border-left: 0;
      border-right: 0;
      & a[data-sort] {
        display: block;
      }
    }
  }
}

#html-upload-ui {
  display: none;
}

.html-uploader {
  #plupload-upload-ui {
    display: none;
  }
  #html-upload-ui {
    display: block;
  }
}

.upload-desc {
  margin-top: @line-height-computed / 2;
}

.media-items {
  .media-item {
    min-height: 36px;
    margin-bottom: 1px;
    position: relative;
    width: 100%;
    background: #fff;
    -webkit-box-shadow: 0 1px 0 #dfdfdf;
    box-shadow: 0 1px 0 #dfdfdf;

    > .pinkynail {
      float: left;
      margin: 2px 10px 0 3px;
      max-width: 40px;
      max-height: 32px;
    }

    > .edit-attachment {
      display: block;
      line-height: 36px;
      float: right;
      margin-right: 10px;
    }

    > .filename {
      line-height: 36px;
      overflow: hidden;
      margin-left: 10px;

      > strong {
        margin-left: 10px;
        color: #ccc;
      }
    }

    > p {
      margin: @line-height-computed / 2 0;
    }

    > .progress {
      margin: 0;
      position: absolute;
      width: 10em;
      right: 10px;
      top: 8px;
      text-align: center;
    }
  }

  .error {
    padding: 1px @line-height-computed / 2;
    border-left: 4px solid @btn-danger-bg;
    .name {
      margin-right: 10px;
    }
  }
}

/* dragdrop */
.drag-drop {
  .drag-drop-area {
    border: 4px dashed #DDDDDD;
    height: 200px;
    margin-bottom: 5px;
  }

  .drag-drop-inside {
    margin: 60px auto 0;
    width: 250px;
    text-align: center;

    p {
      color: #aaa;
      &.drag-drop-info {
        font-size: 20px;
      }
    }
  }

  &.drag-over .drag-drop-area {
    border-color: #83B4D8;
  }
}

/* imgedit */
.imgedit-wrap {
  position: relative;
}

.imgedit-help {
  font-style: italic;
  display: none;
}

.imgedit-menu,
.imgedit-crop-wrap {
  margin-bottom: 10px;
}

.imgedit-scale-warn {
  visibility: hidden;
  color: red;
  font-weight: bold;
}

.imgedit-crop-wrap {
  position: relative;
}

.imgedit-label {
  font-weight: normal;
  display: block;
}

.imgedit-wait {
  position: absolute;
  top: 0;
  background: #fff url(../images/spinner.gif) no-repeat center;
  -webkit-background-size: 20px 20px;
  background-size: 20px 20px;
  opacity: 0.7;
  filter: alpha(opacity=70);
  width: 100%;
  height: 500px;
  display: none;

  @media (max-width: @screen-xs-max) {
    background-image: url(../images/spinner-2x.gif);
    background-size: auto;
  }
}

.imgedit-wrap .imgedit-settings {
  float: right;
  width: 220px;
}

.imgedit-wrap .imgedit-panel-content {
  padding-right: 16px;
  width: auto;
  overflow: hidden;
}

.file-settings {
  .pos-select {
    margin: 0;
    padding: 0;
    list-style: none;
    display: inline-block;
    overflow: hidden;
    width: 131px;
    height: 112px;
    border: 1px solid #c9ccd0;

    > li {
      float: left;
      width: 43px;
      height: 37px;
      text-align: center;
      line-height: 37px;
      cursor: pointer;
      border-right: 1px solid #E4E4E4;
      border-bottom: 1px solid #E4E4E4;
      background-color: #fff;

      &.current {
        background-color: @link-color;
        color: #fff;
      }

      &:nth-child(3n) {
        border-right: 0;
      }
    }
  }
}

.file-settings form label {
  font-weight: normal;
}